import request from '@/utils/request'

export function getJobPageList(params) {
   return request({
    url: '/xxl-job-admin/jobinfo/pageList',
    method: 'post',
     params: params
  })
}

export function create(params) {
  return request({
    url: '/xxl-job-admin/jobinfo/add',
    method: 'post',
    data: params
  })
}

export function remove(id) {
  return request({
    url: '/xxl-job-admin/jobinfo/remove',
    method: 'get',
    params: {id: id}
  })
}

export function update(params) {
  return request({
    url: '/xxl-job-admin/jobinfo/update',
    method: 'post',
    data: params
  })
}
//执行一次触发
export function jobTrigger(param) {
  return request({
    url: '/xxl-job-admin/jobinfo/trigger',
    method: 'post',
    params: param
  })
}

export function nextTriggerTime(scheduleType,scheduleConf) {
  return request({
    url: '/xxl-job-admin/jobinfo/nextTriggerTime',
    method: 'post',
    data: 'scheduleType='+scheduleType+'&scheduleConf='+scheduleConf
  })
}

export function jobStart(id) {
  return request({
    url: '/xxl-job-admin/jobinfo/start',
    method: 'post',
    params: {id: id}
  })
}

export function jobStop(id) {
  return request({
    url: '/xxl-job-admin/jobinfo/stop',
    method: 'post',
    params: {id: id}
  })
}
